﻿<%@ Page Language="C#" MasterPageFile="~/MasterPagePopup.master" AutoEventWireup="true" CodeFile="ServicesModal.aspx.cs" Inherits="FE_ServicesModal" Title="Untitled Page" %>
<%@ Register Src="~/UserControl/CustomerView.ascx" TagName="CustomerView" TagPrefix="uc" %>
<%@ Register Src="~/UserControl/CheckedInView.ascx" TagName="CheckedInView" TagPrefix="uc" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ModalContent" Runat="Server">
    <gr:GuruAjaxManagerProxy runat="server" ID="GuruAjaxManagerProxy1">
        <AjaxSettings>
            <gr:GuruAjaxSetting AjaxControlID="uxAddService">
               <UpdatedControls>
                    <gr:GuruUpdatedControl ControlID="uxServicesGrid" />
               </UpdatedControls>
            </gr:GuruAjaxSetting>
              <gr:GuruAjaxSetting AjaxControlID="uxServicesGrid">
               <UpdatedControls>
                    <gr:GuruUpdatedControl ControlID="uxServicesGrid" />
               </UpdatedControls>
            </gr:GuruAjaxSetting>
        </AjaxSettings>
    </gr:GuruAjaxManagerProxy>
    <gr:Container ID="Container2" runat="server" HeaderText="Khách hàng" AllowExpandCollapse="true">
        <div class="ContainerInput">
            <uc:CheckedInView runat="server" ID="uxCheckedInView" />
            <uc:CustomerView runat="server" ID="uxCustomerView" />            
        </div>
    </gr:Container>
    <div class="section-separator"></div>
    <gr:Container ID="Container1" runat="server" HeaderText="Dịch vụ">
        <div class="containerHasBG" style=" padding:1px 0px 1px 0px; margin:0px">
            <div class="ContainerInput containerInner" style=" padding:0px 5px 0px 5px;">
                <table class="TableFourColumns" cellpadding="0" cellspacing="0">
                    <tr>
                        <td class="label">
                            <gr:Literal runat="server" ID="Literal3" Text="Chọn dịch vụ" />
                        </td>
                        <td class="input">
                            <gr:GuruComboBox runat="server" Enabled="true" ID="uxServices" Width="100%">                               
                            </gr:GuruComboBox>
                        </td>
                        <td class="label">
                            <gr:Literal runat="server" ID="Literal2" Text="Số lượng" />
                        </td>                        
                        <td class="input">
                            <table class="TableFourColumns" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td style="width:100px;">
                                        <gr:GuruNumericTextBox Type="Number" ID="uxNumber" MaxLength="5" MinValue="1" Width="90px"
                                            runat="server">
                                            <NumberFormat DecimalDigits="0" />
                                        </gr:GuruNumericTextBox>
                                    </td>
                                    <td>
                                        <gr:LinkButton ID="uxAddService" CssClass="button buttonGray buttonFixedShort" OnClick="uxAddService_Click"
                                            OnClientClick="return doValidate();" runat="server" SizeType="FixedSmallShort"
                                            CssClassIcon="icon_add" Text="Thêm"></gr:LinkButton>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </div>
            <div style=" text-align:right; font-weight:bold; padding-right:10px;">
                 <gr:Literal runat="server" ID="Literal1" Text="Tổng tiền dịch vụ: " />
                <gr:Literal runat="server" ID="uxTotalAmount"  /> 
            </div>
           
        </div>
        <gr:GuruGrid runat="server" ID="uxServicesGrid" AllowSorting="true" AllowFilteringByColumn="false" 
            AllowPaging="true" PageSize="10" OnNeedDataSource="uxServicesGrid_NeedDataSource" OnItemCommand="uxServicesGrid_ItemCommand">
            <MasterTableView DataKeyNames="InvoiceDetailID">
                <Columns>
                    <gr:GuruGridBoundColumn Format="Sequence" HeaderText="Seq">
                    </gr:GuruGridBoundColumn>
                    <gr:GuruGridTemplateColumn ItemStyle-Width="50px">
                        <ItemTemplate>
                            <gr:LinkButton runat="server" IsStandard="true" ID="uxDelete" Text="Xóa" CommandName="Delete"></gr:LinkButton>
                        </ItemTemplate>
                    </gr:GuruGridTemplateColumn>
                    <gr:GuruGridBoundColumn UniqueName="ServiceName" DataField="ServiceName" HeaderText="Tên dịch vụ">
                    </gr:GuruGridBoundColumn>
                    <gr:GuruGridBoundColumn DataField="Quantity" Format="Number" HeaderText="Số lượng">
                    </gr:GuruGridBoundColumn>
                    <gr:GuruGridBoundColumn DataField="Price" Format="Currency" HeaderText="Đơn giá">
                    </gr:GuruGridBoundColumn>
                    <gr:GuruGridBoundColumn DataField="Amount" Format="Currency" HeaderText="Thành tiền">
                    </gr:GuruGridBoundColumn>       
                           
                </Columns>
            </MasterTableView>
           
        </gr:GuruGrid>
    </gr:Container>
     <gr:ContainerButton ID="ContainerButton2" runat="server">        
        <gr:LinkButton ID="uxClose" runat="server" SizeType="FixedSmallShort" Text="Đóng"
            CssClassIcon="icon_delete" OnClientClick="return parent.ClosePopupModal(1)"></gr:LinkButton>
    </gr:ContainerButton>
     <gr:Validator ID="Validator1" runat="server" ValidationFunction="doValidate" MessageType="AlertBox">
        <Items>
            <gr:BasicValidationItem ControlToValidateID="uxNumber" Rule="Required"/>
            <gr:BasicValidationItem ControlToValidateID="uxServices" Rule="Required"/>
        </Items>
    </gr:Validator>
</asp:Content>

